<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>

    .layui-upload-colse {
        position: relative;
    }

    .closeUpload {
        position: absolute;
        top: 0;
        right: 0;
        width: 20px;
        height: 20px;
        cursor: pointer;
    }

    .upImg {
        width: 80px;
        height: 80px;
    }

    .formfixed {
        position: relative;
    }

    .remove {
        position: absolute;
        top: 125%;
        right: -175px;
        transform: translateY(-50%);
        cursor: pointer;
    }

    .myheader {
        height: 140px;
        background-color: #FFFFFF;
        padding: 20px 0;
        display: flex;
        align-items: center;
        margin: 0;
        flex-wrap: wrap;
    }

    .layui-tab {

        overflow: auto;
        background-color: #FFFFFF;
        margin: 10px 0 0 0;
    }

    .layui-input-block1 {
        display: flex;
        align-items: center;
        justify-content: flex-start
    }
    .layui-tab-title{
        height: 40px!important;
    }
    .layui-tab-content{
        height: calc(100% - 40px);
        overflow: auto;
    }
</style>
<body>
<input id="inputType" th:value="${type}" style="display: none">
<input id="id" th:value="${id}" style="display: none">
<div class="layui-fluid mt2" style="background-color: #f0f2f5">
    <form class="layui-form" style="height: 100%;">
        <div class="layui-form-item " style="display: flex" >
            <div class="layui-form-item " style="width:50%">
                <label class="layui-form-label required">入住人</label>
                <input id="userId" th:value="${myData?.sysUserid}" style="display: none">
                <input id="nameValue" th:value="${myData?.username}" style="display: none">
                <input id="phoneValue" th:value="${myData?.phone}" style="display: none">
                <input id="sexValue" th:value="${myData?.sex}" style="display: none">
                <input id="projectNameValue" th:value="${myData?.projectName}" style="display: none">
                <input id="projectIdValue" th:value="${myData?.projectId}" style="display: none">
                <div class="layui-input-block">
                    <select lay-affix="clear" id="mySelect" lay-search=""  name="mySelect" lay-verify="required"  lay-filter="demo-select-filter">
                        <option value="">请等待数据加载</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item" style="width: 50%">
                <label class="layui-form-label required">联系方式</label>
                <div class="layui-input-block ">
                    <div class="form-control" id="phone">
                        <span style="color: rgb(117 117 117);" th:text="${'add'==type?'请先选择姓名':myData?.phone}"></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-form-item "  style="display: flex"  >
            <div class="layui-form-item "  style="width: 50%">
                <label class="layui-form-label required">性别</label>
                <div class="layui-input-block ">
                    <div class="form-control" id="sex">
                        <span style="color: rgb(117 117 117);" th:text="${type=='add'?'请先选择姓名':(myData?.sex== '1'?'男':'女')}"></span>
                    </div>
                </div>
            </div>
<!--            <div class="layui-form-item" style="width: 50%" >-->
<!--                <label class="layui-form-label">服务类型</label>-->
<!--                <div class="layui-input-block " >-->
<!--                    <div class="form-control" id="jazSysProject">-->
<!--                        <span style="color: rgb(117 117 117);" th:text="${'add'==type?'请先选择姓名':myData?.projectName}"></span>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="layui-form-item" style="width: 50%">
                <label class="layui-form-label required">入住时间</label>
                <div class="layui-input-block">
                    <input name="checkTime" class="form-control startTime" type="text"
                           lay-verify="required"
                           id="startTime"
                           th:disabled="${type=='edit'}"
                           th:value="${myData?.movieHouseTime} eq null  or ${myData?.movieHouseTime} eq '' ?'': ${#dates.format(myData?.movieHouseTime, 'yyyy-MM-dd HH:mm:ss')}"
                           placeholder="请输入入住时间">
                </div>
            </div>
        </div>


        <div class="layui-form-item" style="display: flex" >


            <div class="layui-form-item" style="width: 50%">
                <label class="layui-form-label">离开时间</label>
                <div class="layui-input-block">
                    <input name="endTime" class="form-control endTime" type="text"
                           id="endTime"
                           th:value="${myData?.leaveTime} eq null or ${myData?.leaveTime} eq ''? '' : ${#dates.format(myData?.leaveTime, 'yyyy-MM-dd HH:mm:ss')}"
                           placeholder="请输入离开时间">
                </div>
            </div>
        </div>

        <div class="layui-form-item " >
            <label class="layui-form-label required">小区名称</label>
            <input id="communityName" th:value="${myData?.communityName}" style="display: none">
            <div class="layui-input-block">
                <select lay-affix="clear" id="mySelect1" lay-search=""  name="mySelect1"  lay-filter="demo-select-filter1">
                    <option value="">请等待数据加载</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item " >
            <label class="layui-form-label required">楼栋房号</label>
            <input id="buildNumber" th:value="${myData?.buildNumber}" style="display: none">
            <div class="layui-input-block">
                <select lay-affix="clear" id="mySelect2" lay-search=""  name="mySelect2"    lay-filter="demo-select-filter2">
                    <option value="">请选择小区名称</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item " >
            <label class="layui-form-label required">床号</label>
            <input id="bedCode" th:value="${myData?.bedCode}" style="display: none">
            <input id="bedNumberId" th:value="${myData?.bedNumberId}" style="display: none">
            <div class="layui-input-block">
                <select lay-affix="clear" id="mySelect3" lay-search=""  name="mySelect3"   >
                    <option value="">请选择楼栋房号</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item" th:if="${type!='add'}" style="background: #fff;padding: 0;  width: calc(100% - 10px);height: 150px">
            <label class="layui-form-label">审核结果</label>
            <input   name="auditResult"   th:value="${myData?.auditResult}" style="display: none" th:if="${!(null==myData||myData.auditStatus == 0)}">
            <div  class="layui-input-block" th:if="${null==myData||myData.auditStatus == 0}">
                <input type="radio" lay-filter="demo-radio-filter" name="auditResult" value="0" title="已通过" th:checked="${myData?.auditResult==0}">
                <input type="radio" lay-filter="demo-radio-filter" name="auditResult" value="1" title="未通过" th:checked="${myData?.auditResult==1}" >
            </div>
            <div  class="layui-input-block layui-input-block1" th:if="${null!=myData && myData?.auditResult!=2}" th:text="${(myData?.auditResult==0||myData?.auditResult==3)?'通过':((myData?.auditResult==1)?'拒绝':'未审核')}">
            </div>
            <div class="layui-input-block" th:style="${myData?.auditResult==1?'display: block':'display: none'}"  id="refuseReason">
                            <textarea name="refuseReason" placeholder="请输入拒绝原因" lay-verify="introduction"
                                      th:utext="${myData?.refuseReason}"
                                      th:disabled="${myData?.auditResult==1}"
                                      class="layui-textarea"></textarea>
            </div>

        </div>

       <div class="layui-form-item  layui-flow-more">
            <div class="layui-inline">
                <button type="button" class="layui-btn" lay-submit lay-filter="submit">立即提交</button>
            </div>
        </div>

    </form>
</div>

<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/xmSelect.js"></script>
<script type="text/javascript" src="/js/webJs/jzweb/jazUserAuntStay/add.js"></script>
</body>
</html>